package com.ruoyi.produce.process.planoutsource.mapper;

import com.ruoyi.produce.process.planoutsource.domain.ProducePlanOutsource;
import com.ruoyi.produce.process.planoutsource.domain.ProducePlanOutsourceCond;

import java.util.List;

/**
 * 委外生产计划
 * 数据层
 * @author Drj 2021/6/28
 */
public interface ProducePlanOutsourceMapper {
    /**
     * 查找委外生产计划
     * @param cond
     * @return
     */
    public List<ProducePlanOutsource> selectProducePlanOutsourceList(ProducePlanOutsourceCond cond);

    /**
     * 根据编号查找指定委外生产计划
     *
     * @param planOutsourceId 委外生产计划编号
     * @return
     */
    public ProducePlanOutsource selectProducePlanOutsourceById(String planOutsourceId);

    /**
     * 根据生产计划编号查询是否有委外记录
     * @param planSelfId
     * @return
     */
    List<ProducePlanOutsource> selectProducePlanOutsourceByPlanSelfId(String planSelfId);

    /**
     * 新增委外生产计划
     * @param producePlanOutsource
     * @return
     */
    public int insertProducePlanOutsource(ProducePlanOutsource producePlanOutsource);

    /**
     * 更新委外生产计划
     * @param producePlanOutsource
     * @return
     */
    public int updateProducePlanOutsource(ProducePlanOutsource producePlanOutsource);

    /**
     * 删除委外生产计划
     * 仅修改委外生产计划删除标志
     * @param producePlanOutsource
     * @return
     */
    public int updateProducePlanOutsourceDeleteFlag(ProducePlanOutsource producePlanOutsource);

    /**
     * 获取最新的一条委外生产计划编号
     * @return
     */
    String getPlanOutsourceId();

    /**
     * 更新审批状态
     * @return
     */
    int completeApprovalFlag(String planOutsourceId);

    /**
     * 更新审批状态
     * @return
     */
    int refuseApprovalFlag(String planOutsourceId);
}
